package com.atguigu.edu.realtime.util;

/**
 * @Author zhangsan
 * @Date 2022/10/18 20:52
 * @Description //TODO 连接mysql数据库
 */
public class MySqlUtil {


    //获取jdbc连接器相关连接属性
    public static String mysqlLookUpTableDDL(String tableName){

        return "WITH (\n" +
                "   'connector' = 'jdbc',\n" +
                "   'url' = 'jdbc:mysql://hadoop101:3306/edu',\n" +
                "   'username' = 'root',\n" +
                "   'password' = '000000',\n" +
                "   'driver' = 'com.mysql.cj.jdbc.Driver',\n" +
                "   'table-name' = '" + tableName + "',\n" +
                "   'lookup.cache.max-rows' = '200',\n" +
                "   'lookup.cache.ttl' = '1 hour'\n" +
                ")";
    }
}
